# coding: utf-8

import sys
sys.path.append('../3_data_structure')
from queue import Queue


def hot_potato(mans, num):
    queue = Queue()

    for man in mans:
        queue.enqueue(man)

    while queue.size() > 1:
        for i in range(num):
            queue.enqueue(queue.dequeue())

        queue.dequeue()

    return queue.dequeue()


children = ["Bill", "David", "Susan", "Jane", "Kent", "Brad"]

print(hot_potato(children, 7))
